Repository navigation
feat(git): declare the board and notes merge=union - #663
Merged
Merged
Conversation
The repo shipped every union mechanism (wrap's carry-across-pull, the union re-merge, the board dedupe) and no .gitattributes of its own, so `git check-attr merge -- _meta/BACKLOG.md` answered `unspecified`. Two sessions adding a board row collided by hand; one sitting resolved the same stash-pop conflict four times. Declaring the board, the staging board and the implementation notes union clears both collisions at the source: git's union driver resolves the stash pop, and a parallel-branch merge on the table keeps both rows. That declaration also makes wrap's carry-across-pull path reachable for the board, which had no `---` anchor and would have prepended a carried row to line one, above the title. `_carry_after_neighbour` places the block after the line it followed locally, and only when the anchor rule finds nothing, so every anchored file keeps today's placement. The brief asked instead for a hunk resolver on the POP CONFLICT path. That was refuted before any code: a measured repro shows `git stash pop` resolving a union-declared text file with no markers, and tests/test-wrap.sh has asserted the same since the pull-past-dirty work. Evidence and the rejected alternative are in docs/implementation-notes/gitattributes-union.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The repo now carries a
.gitattributesdeclaring_meta/BACKLOG.md,_meta/backlog-staging.mdanddocs/implementation-notes/*.mdmerge=union. It never had one.Board row: ID-886.
Why
The kit shipped every union mechanism (wrap's carry-across-pull, the union re-merge,
board dedupe-all) and no declaration of its own, sogit check-attr merge -- _meta/BACKLOG.mdansweredunspecified. Two sessions adding a row collided by hand: one sitting resolved the same stash-pop conflict four times, each time a stash push, an ff-only merge, a conflicted pop, a throwaway script over the hunks, and a reset to leave the row unstaged. ops-toolkit declares the same file union and never needed it.The brief asked for something else
The brief asked for a hunk resolver on
bin/wrap apply's POP CONFLICT path, on the premise thatgit stash popleaves markers on a union-declared file. Refuted before any code:tests/test-wrap.shhas asserted this since the pull-past-dirty work, andlib/wrap/wrap.shstates it in the_unstashcomment.check-attr == uniongate would not have fired on either.Evidence and the rejected alternative:
docs/implementation-notes/gitattributes-union.md.The one code change the declaration forced
Declaring the board union makes wrap's carry-across-pull path reachable for it. That path inserted below the first
---line; the board has none, so a carried row would have landed at line 1, above the title._union_carry_backnow keeps the anchor rule for a file that has an anchor and runsgit merge-file --unionover pulled/base/local for a file that has none. Narrowing it that way leaves every asserted contract intact: the driver orders the incoming entry above the local one, which is backwards for a newest-firstLAB_LOG.A first attempt placed the block after its local neighbour. Review broke that four ways (blank neighbour, repeated neighbour, non-contiguous lines, empty first line); the driver answers all four in less code.
Verification
bash tests/test-gitattributes-union.shbash tests/test-wrap.shbash tests/test-meta.shbash lib/gate/negctl.sh . "bash tests/test-gitattributes-union.sh" "rm .gitattributes"Proof of done:
docs/verification/gitattributes-union.md.Accepted tradeoff
Union never drops a line, so two branches flipping the same row's Status yield that row twice instead of a conflict. The next
board setthen refuses with "matches N rows; dedupe first", which is loud and recoverable. The.gitattributescomment names it and says to check which side's Statusdedupe-allkept. ops-toolkit made the same call.